<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        Array.prototype.push = function(){
            console.log("失效了")
        }
        var arr = []
        arr.push(4)
        console.log(arr)//[]
        //remove(value)
        Array.prototype.remove = function(val){
            var index = this.indexOf(val)
            this.splice(index,1);
            return this;
        }
        var arr = [5,6,7];
        console.log(arr.remove(6))//[5,7]
        Array.prototype.sum = function(){
            var s = 0 ;
            for(var i =0 ;i<this.length;i++){
                s+=this[i]
            }
            return s;
        }
        var test = [1,2,3,4,5]
        console.log(test.sum())//15
    </script>
</body>
</html>